<?php
/* 
 * The display class is concerned with presentation from
 * the php layer.
 * This class ensures the same styling throughout the application.
 *
 */
class Display {

    /**
     * This function allows a frame to be displayed around a text
     * the frame can be of type bad (e.g.: red), good (green) or
     * standard (gray).
     *
     * @param <string> $type:   a keyword (bad,good) to influence the
     *                          styling of the frame
     * @param <string> $text:   The text to be displayed
     * @return <string>         The styled text as HTML
     */
    function frameText($type, $text){
        $style = "";
        switch ($type) {
            case "bad" :
                $style = "<div class=\"warningbox\">";
                break;
            case "good" :
                $style = "<div class=\"successbox\">";
                break;
            default :
                $style = "<div class=\"defaultbox\">";
        }
        $box = "$style
            <b style=\"background-color:#FF0000; color:#FFFFFF;\">
            &nbsp;&nbsp;!&nbsp;&nbsp;</b>&nbsp;
            $text</div><br>\n
        ";
        return ($box);
    }
    
}
?>
